﻿
namespace AzukiMap.MapSource
{
    public class PostGisTable : VectorSource
    {
        /*
        f_table_catalog   | character varying(256) | not null
        f_table_schema    | character varying(256) | not null
        f_table_name      | character varying(256) | not null
        f_geometry_column | character varying(256) | not null
        coord_dimension   | integer                | not null
        srid              | integer                | not null
        type              | character varying(30)  | not null
        */

        string _dbName;
        string _tableName;
        string _geometryColumn;
        string _tableCatalog;
        string _tableSchema;

        public string DbName
        {
            get { return _dbName; }
            set { _dbName = value; }
        }

        public string GeometryColumn
        {
            get { return _geometryColumn; }
            set { _geometryColumn = value; }
        }

        public string TableName
        {
            get { return _tableName; }
            set { _tableName = value; }
        }

        public string TableCatalog
        {
            get { return _tableCatalog; }
            set { _tableCatalog = value; }
        }

        public string TableSchema
        {
            get { return _tableSchema; }
            set { _tableSchema = value; }
        }

        public PostGisTable(string name, MapSourceTypes type, int srid, CoordinationUnits coordUnit)
            : base(name, type, srid, coordUnit)
        {
        }

        public bool Compare(PostGisTable other)
        {
            if (_type == other._type &&
                _dbName == other._dbName &&
                _geometryColumn == other._geometryColumn &&
                _srid == other._srid &&
                _tableName == other._tableName &&
                _tableCatalog == other._tableCatalog &&
                _name == other._name &&
                _tableSchema == other._tableSchema)
            {
                return true;
            }
            else
            {
                return false;
            }
        }

    }
}
